package com.longchat.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.longchat.domain.User;
import com.longchat.repository.UserJpaRepository;
import com.longchat.service.IUserService;

@Service
@Transactional
public class UserService implements IUserService {


	@Autowired
	private UserJpaRepository userJpaRepository;
	
	public List<User> findAll() {
		return userJpaRepository.findAll();
	}

	public void saveUser(User book) {
		userJpaRepository.save(book);
	}

	public User findOne(long id) {
		return userJpaRepository.findOne(id);
	}

	public void delete(long id) {
		userJpaRepository.delete(id);
	}

	public List<User> findByName(String name) {
		return userJpaRepository.findByName(name);
	}
	

}
